package com.consumer.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author：Administrator
 * @Date：2022/7/25/0025 23:41
 * @Versiion：1.0
 */
@Configuration
public class ApplicationContextConfig {

    /**
     * LoadBalanced可以在注册中心通过服务名映射到ip+port
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
